var a = "";
var b = "";
var c = "";
var e = "";
var t = "";

function preview() {
    bdhtml = window.document.body.innerHTML;
    sprnstr = "<!--startprint-->";
    eprnstr = "<!--endprint-->";
    prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 17);
    prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
    window.document.body.innerHTML = prnhtml;
    window.print();
}

$.post("../userinfo/getInfo",
    function () {

    })
    .success(function (data, status) {
        var age=data.age;
        var xueli=data.educationexp;

        if(age==null)
            age="";
        if(xueli==null)
            xueli="";
        if(age=="null")
            age="";
        if(xueli=="null")
            xueli="";
        a = "<tbody>" +
            " <tr>" +
            "     <td colspan='10' align='center'><font size='6'>个人简历</font></td>" +
            " </tr>" +
            " <tr>" +
            "     <td colspan='10'>" +
            "         <font size='3' face='arial'>【基本信息】</font>" +
            "     </td>" +
            " </tr>" +
            " <tr>" +
            "     <td width='90px' align='center'>姓名</td>" +
            "     <td width='400px' align='center'>" + data.name + "</td>" +
            "     <td width='90px' align='center'>性别</td>" +
            "     <td width='400px' align='center' colspan='7'>" + data.sex + "</td>" +
            " </tr>" +
            " <tr>" +
            "     <td align='center'>年龄</td>" +
            "     <td align='center'>" + age + "</td>" +
            "     <td align='center'>户籍</td>" +
            "     <td align='center' colspan='7'>" + data.nativeplace + "</td>" +
            " </tr>" +
            " <tr>" +
            "     <td align='center'>学历</td>" +
            "     <td align='center'>" + xueli + "</td>" +
            "     <td align='center'>专业</td>" +
            "     <td align='center' colspan='7'>" + data.profession + "</td>" +
            " </tr>" +
            " <tr align='center'>" +
            "     <td>英语等级</td>" +
            "     <td>" + data.englishlevel + "</td>" +
            "     <td>移动电话</td>" +
            "     <td colspan='2'>" + data.phone + "</td>" +
            " </tr>" +
            " <tr>" +
            "     <td width='90px' align='center'>工作经验</td>" +
            "     <td width='280px' align='center'>10年以上</td>" +
            "     <td width='90px' align='center'>电子邮件</td>" +
            "     <td width='400px' align='center' colspan='7'>" + data.mail + "</td>" +
            " </tr>" +
            " <tr>" +
            "     <td colspan='10'>" +
            "         <font size='3' face='arial'>【求职查询】</font>" +
            "     </td>" +
            " </tr>" +
            " <tr align='center'>" +
            "     <td>工作性质</td>" +
            "     <td>全职</td>" +
            "     <td>目标地点</td>" +
            "     <td colspan='2'>" + data.city + "</td>" +
            " </tr>" +
            " <tr align='center'>" +
            "     <td>目标职能</td>" +
            "     <td>" + data.functions + "</td>" +
            "     <td>薪酬待遇</td>" +
            "     <td colspan='2'> 8k/月</td>" +
            " </tr>" +
            " <tr>" +
            "     <td colspan='10'>" +
            "         <font size='3' face='arial'>【综合技能】</font>" +
            "     </td>" +
            " </tr>" +
            " <tr align='center'>" +
            "     <td>专业技能</td>" +
            "     <td colspan='8'>" + data.functions + "</td>" +
            " </tr>" +
            " <tr align='center'>" +
            "     <td>教育经历</td>" +
            "     <td colspan='8'>" + data.educationexp + "</td>" +
            " </tr>"


        c = " <tr>" +
            "     <td align='center'>自我评价</td>" +
            "     <td colspan='8'>" + data.selfassessment + "</td>" +
            " </tr>"

        $.post("../userinfo/pro", function () {
        }).success(function (data, status) {

            $.each(data, function (index, item) {
                t = t +
                    "<tr>" +
                    "     <td colspan='10'>" +
                    "         <font size='5' face='黑体'> " + item.name + "</font>" +
                    "     </td>" +
                    " </tr>" +
                    " <tr align='center'>" +
                    "     <td>开发周期</td>" +
                    "     <td colspan='8'>" + item.deCycle + "</td>" +
                    " </tr>" +
                    " <tr align='center'>" +
                    "     <td>开发环境</td>" +
                    "     <td colspan='8'>" + item.devEnv + "</td>" +
                    " </tr>" +
                    " <tr align='center'>" +
                    "     <td>开发工具</td>" +
                    "     <td colspan='8'>" + item.deTool + "</td>" +
                    " </tr>" +
                    " <tr>" +
                    "     <td align='center'>项目描述</td>" +
                    "     <td colspan='8'>" + item.proShow + "</td>" +
                    " </tr>" +
                    " <tr>" +
                    "     <td align='center'>责任描述</td>" +
                    "     <td colspan='8'>" + item.content + "</td>" +
                    " </tr>";
            })
            b = "<tr>" +
                "     <td colspan='10'>" +
                "         <font size='3' face='arial'>【项目经验】</font>" +
                "     </td>" +
                " </tr>" + t +
                " </tbody>"

            $("#document").ready(function () {
                e = a + b + c +
                    " <!--endprint-->" +
                    " <tr>" +
                    "     <th colspan='9'>" +
                    "         <center>" +
                    "             <button id='b2' class='btn btn-success ' onclick='preview()'>打印</button>" +
                    "         </center>" +
                    "     </th>" +
                    " </tr>" +
                    " </th>";
                $("#table3").append(e);
            })
        }).error(function (data, status) {
            b = data + "<p>" + status;

        })
    }).error(function (data, status) {
    a = data + "<p>" + status;
})




